/* 简历编辑器样式 */

/* 编辑器容器 */
.editor-container {
    display: flex;
    height: calc(100vh - 70px);
    background-color: var(--color-gray-100);
}

/* 侧边栏 */
.editor-sidebar {
    width: 320px;
    background-color: #fff;
    border-right: 1px solid var(--color-gray-200);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.resume-info {
    padding: 16px;
    border-bottom: 1px solid var(--color-gray-200);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.resume-title-input {
    font-size: 16px;
    font-weight: 600;
    border: 1px solid transparent;
    padding: 6px 8px;
    border-radius: 4px;
    width: 100%;
    background-color: transparent;
}

.resume-title-input:hover {
    border-color: var(--color-gray-200);
}

.resume-title-input:focus {
    border-color: var(--color-primary);
    background-color: #fff;
    outline: none;
}

.resume-actions {
    display: flex;
    gap: 8px;
}

.resume-actions .btn {
    flex: 1;
    justify-content: center;
}

.template-preview {
    padding: 16px;
    border-bottom: 1px solid var(--color-gray-200);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.template-preview img {
    width: 100%;
    max-width: 200px;
    height: auto;
    border: 1px solid var(--color-gray-200);
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.template-preview .btn {
    width: 100%;
    justify-content: center;
}

/* 编辑器选项卡 */
.editor-tabs {
    display: flex;
    border-bottom: 1px solid var(--color-gray-200);
}

.editor-tab {
    flex: 1;
    padding: 12px 16px;
    text-align: center;
    font-weight: 500;
    color: var(--color-gray-600);
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.editor-tab:hover {
    color: var(--color-gray-900);
}

.editor-tab.active {
    color: var(--color-primary);
}

.editor-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-primary);
}

/* 编辑器部分列表 */
.editor-sections {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.section-item {
    margin-bottom: 8px;
    border: 1px solid var(--color-gray-200);
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.section-item.active {
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 1px var(--color-primary-light);
}

.section-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    background-color: #fff;
    cursor: pointer;
}

.section-header img {
    width: 18px;
    height: 18px;
    margin-right: 8px;
}

.section-header span {
    flex: 1;
    font-weight: 500;
}

.section-toggle {
    transition: transform 0.2s ease;
}

.section-item.active .section-toggle {
    transform: rotate(180deg);
}

.add-section {
    margin-top: 16px;
}

.add-section .btn {
    width: 100%;
    justify-content: center;
}

/* 样式选项卡内容 */
.style-group {
    margin-bottom: 24px;
}

.style-group h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-gray-800);
}

.color-themes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-theme {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--theme-color);
    border: 2px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-theme.active {
    border-color: var(--color-gray-800);
}

.color-theme.custom {
    background-color: #fff;
    border: 2px dashed var(--color-gray-300);
}

.color-theme.custom img {
    width: 16px;
    height: 16px;
    opacity: 0.5;
}

.range-slider {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider {
    flex: 1;
    height: 4px;
    background: var(--color-gray-200);
    outline: none;
    -webkit-appearance: none;
    border-radius: 2px;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.range-value {
    min-width: 40px;
    text-align: right;
    font-size: 14px;
    color: var(--color-gray-600);
}

/* 设置选项卡内容 */
.settings-group {
    margin-bottom: 24px;
}

.settings-group h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-gray-800);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* AI助手 */
.ai-assistant {
    border-top: 1px solid var(--color-gray-200);
    padding: 16px;
    position: relative;
}

.ai-assistant-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: 500;
    color: var(--color-primary);
    cursor: pointer;
    width: 100%;
    justify-content: center;
}

.ai-assistant-toggle img {
    width: 20px;
    height: 20px;
}

.ai-assistant-panel {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 100%;
    background-color: #fff;
    border: 1px solid var(--color-gray-200);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
    z-index: 10;
    display: none;
}

.ai-assistant-panel.active {
    display: block;
}

.ai-assistant-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-gray-200);
}

.ai-assistant-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.ai-assistant-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--color-gray-500);
    cursor: pointer;
}

.ai-assistant-content {
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.ai-suggestions {
    margin-bottom: 16px;
}

.ai-suggestions h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-gray-800);
}

.ai-suggestion-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
    background-color: var(--color-gray-50);
    border-radius: 6px;
    margin-bottom: 8px;
}

.ai-suggestion-item img {
    width: 16px;
    height: 16px;
    margin-top: 2px;
}

.ai-suggestion-item p {
    flex: 1;
    margin: 0;
    font-size: 14px;
}

.ai-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.ai-actions .btn {
    flex: 1;
    justify-content: center;
}

.ai-chat {
    border: 1px solid var(--color-gray-200);
    border-radius: 6px;
    overflow: hidden;
}

.ai-chat-messages {
    padding: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.ai-message {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.ai-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.message-content {
    flex: 1;
    background-color: var(--color-gray-50);
    border-radius: 0 8px 8px 8px;
    padding: 8px 12px;
}

.message-content p {
    margin: 0;
    font-size: 14px;
}

.ai-chat-input {
    display: flex;
    border-top: 1px solid var(--color-gray-200);
    padding: 8px 12px;
}

.ai-chat-input input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
}

.send-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.send-btn img {
    width: 20px;
    height: 20px;
    opacity: 0.6;
}

.send-btn:hover img {
    opacity: 1;
}

/* 编辑器主体 */
.editor-main {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background-color: var(--color-gray-100);
}

.editor-form-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 24px;
    max-width: 800px;
    margin: 0 auto;
}

.section-form h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--color-gray-900);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-gray-200);
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--color-gray-700);
}

.photo-upload {
    margin-top: 24px;
}

.photo-preview {
    display: flex;
    align-items: center;
    gap: 16px;
}

.photo-preview img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--color-gray-200);
}

.photo-upload-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--color-gray-50);
    border: 1px dashed var(--color-gray-300);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    color: var(--color-gray-600);
    cursor: pointer;
}

.photo-upload-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.photo-upload-btn img {
    width: 16px;
    height: 16px;
}

/* 预览区域 */
.editor-preview {
    width: 40%;
    background-color: var(--color-gray-100);
    border-left: 1px solid var(--color-gray-200);
    display: flex;
    flex-direction: column;
}

.preview-toolbar {
    padding: 12px 16px;
    background-color: #fff;
    border-bottom: 1px solid var(--color-gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.zoom-level {
    font-size: 14px;
    color: var(--color-gray-600);
    min-width: 40px;
    text-align: center;
}

.page-navigation {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-info {
    font-size: 14px;
    color: var(--color-gray-600);
}

.page-buttons {
    display: flex;
    gap: 4px;
}

.preview-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    justify-content: center;
}

.resume-preview-page {
    width: 21cm;
    height: 29.7cm;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 20mm;
    position: relative;
    transform-origin: top center;
    transform: scale(0.7);
}

/* 简历内容样式 */
.resume-content {
    height: 100%;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-gray-900);
}

.resume-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-primary-light);
}

.resume-name-title h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--color-primary);
}

.resume-title {
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    color: var(--color-gray-700);
}

.resume-contact {
    text-align: right;
}

.resume-contact p {
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.resume-contact p img {
    width: 14px;
    height: 14px;
}

.resume-summary {
    margin-bottom: 20px;
}

.resume-summary h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: var(--color-primary);
    padding-bottom: 6px;
    border-bottom: 1px solid var(--color-gray-200);
}

.resume-summary p {
    margin: 0;
    text-align: justify;
}

.resume-section {
    margin-bottom: 20px;
}

.resume-section h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: var(--color-primary);
    padding-bottom: 6px;
    border-bottom: 1px solid var(--color-gray-200);
}

.resume-item {
    margin-bottom: 16px;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.item-header h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: var(--color-gray-900);
}

.item-date {
    font-size: 14px;
    color: var(--color-gray-600);
}

.item-subtitle {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 6px 0;
    color: var(--color-gray-700);
}

.item-details {
    margin: 0;
    padding-left: 20px;
}

.item-details li {
    margin-bottom: 4px;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .editor-preview {
        width: 35%;
    }
}

@media (max-width: 992px) {
    .editor-container {
        flex-direction: column;
        height: auto;
    }
    
    .editor-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--color-gray-200);
    }
    
    .editor-main {
        height: 500px;
    }
    
    .editor-preview {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--color-gray-200);
        height: 500px;
    }
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .resume-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .resume-contact {
        text-align: left;
    }
    
    .resume-contact p {
        justify-content: flex-start;
    }
}

/* 下拉菜单 */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dropdown-icon {
    width: 12px;
    height: 12px;
    transition: transform 0.2s ease;
}

.dropdown.active .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 160px;
    background-color: #fff;
    border: 1px solid var(--color-gray-200);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
    display: none;
}

.dropdown.active .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--color-gray-800);
    text-decoration: none;
}

.dropdown-item:hover {
    background-color: var(--color-gray-50);
}

/* 用户下拉菜单 */
.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background-color: #fff;
    border: 1px solid var(--color-gray-200);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 100;
    margin-top: 8px;
    display: none;
}

.user-dropdown.active .user-dropdown-menu {
    display: block;
}

.user-dropdown-menu a {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--color-gray-800);
    text-decoration: none;
    transition: all 0.2s ease;
}

.user-dropdown-menu a:hover {
    background-color: var(--color-gray-50);
}

.user-dropdown-menu a.logout-link {
    border-top: 1px solid var(--color-gray-200);
    color: var(--color-danger);
}

/* 按钮图标 */
.btn img {
    width: 16px;
    height: 16px;
}

.btn-icon {
    padding: 6px;
    min-width: auto;
}

.btn-icon img {
    margin: 0;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.dropdown-menu, .user-dropdown-menu, .ai-assistant-panel {
    animation: fadeIn 0.2s ease;
}